<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld"%>
<%@include file="taglibs.jsp"%>    

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
      <title>Version of ${actionBean.page_ID }</title>      
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {        
	      data = new google.visualization.DataTable();
	      data.addColumn('date', 'Date');
	      data.addColumn('number', 'Relevancy');
	      
	      <c:forEach var="result" items="${actionBean.results}">
	      	data.addRow([new Date("${result.revisionStr}"), ${result.score}]);
	      </c:forEach>
	      
        var options = {
          title: 'Version relevancies',
          vAxis: {title: 'Score', minValue: 0},
          hAxis: {title: 'Date'},
          legend: 'none',
        };

        //var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
        var chart = new google.visualization.ScatterChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>
          
  </head>
  <body>
  	<div class="visualization">
		<div id="chart_div" style="width: 900px; height: 500px;"></div>			
		<div>
		${actionBean.numFound } versions:
		<c:forEach var="version" items="${actionBean.results}" varStatus="versionRank" begin="0">
			<%@include file="aversion.jsp"%>
		</c:forEach>
		</div>
	</div>
  </body>
</html>